package com.xyhuo.leetcode.june;

/**
 * 2938. 区分黑球和白球
 * https://leetcode.cn/problems/separate-black-and-white-balls/
 */
public class MinimumSteps {

    private Integer a;

    private Integer b;

    public Integer getA() {
        return a;
    }

    public void setA(Integer a) {
        this.a = a;
    }

    public Integer getB() {
        return b;
    }

    public void setB(Integer b) {
        this.b = b;
    }

    public long minimumSteps(String s) {
        char[] list = s.toCharArray();
        int oneCount = 0;
        long ans = 0;
        for (int i = 0; i < list.length; i++) {
            if (list[i] == '0') {
                ans += oneCount;
            } else if (list[i] == '1') {
                oneCount++;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        MinimumSteps m=new MinimumSteps();
        m.setA(1);
        m.setB(2);
        Integer c= m.getA()-m.getB();
        System.out.println(c);
    }
}
